package bestfriends.tamu;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.view.Menu;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends Activity {
	ArrayList<Person> people;
	ArrayList<Question> questions;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
       
        //Where is ListManager initialized?
        

    	   ListManager.people = ReadXMLFile.xStreamData(this);
    	   ListManager.questions = ReadXMLFile.xStreamQuestion(this);    	   
    	   //Toast.makeText(getApplicationContext(), "People :" + ListManager.people.size() + "Questions :" + ListManager.questions.size(), Toast.LENGTH_LONG).show();

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
    @Override
    protected void onDestroy() {
    	super.onDestroy();
    	ListManager.writeArraysToSD();
    }
    
    public void loadCompare(View v) {
    	Intent i = new Intent(MainActivity.this, Compare.class );
    	MainActivity.this.startActivity(i);
    }
    
    public void loadHighScores(View v) {
    	Intent i = new Intent(MainActivity.this, HighScores.class );
    	MainActivity.this.startActivity(i);
    }
}

